Computational Theory | |
The heart of the study of computer science.
What can computers do?The technology is irrelevant. Instead... Abstract mathematical model of computer.Inputs cause ...
EXAMPLE Program to determine whether the input tape contains all of the same input symbols. STATE DIAGRAM VIEW OF THE TM
Output: Blank tape: Valid input (TM accepts the tape) -- TMs are often used to accept an input Demo on several input tapes on the board. 5-TUPLES REPRESENTATION OF THE TM Shorthand symbolism: List the machine as a set of rules:
The machine has rules,
which lead to its program set,(1,0,b,R,2) (1,1,b,R,4) (2,0,b,R,2) (2,b,b,R,3) (4,1,b,R,4) (4,b,b,R,3)
SERIAL NUMBER OF THE TM
Then, list all the rules, separated by 11:
Then surround the entire collection with 111's and we have a Turing Machine definition in binary. This is often
called the SERIAL NUMBER of the TM.
This Turing Machine was designed to spot an input string of either all 1's or all 0's. When the machine reached the final state (halt state) then the string on the tape contained all blanks. This indicated the input string indeed contained all 0's or 1's. Let's change the machine slightly so that it leaves the original string alone and gives us a "F" for false and a "T" for true. Let's begin by looking at the input tape and deciding how and where we should place the "F" or "T". The first position on the tape looks like a logical place to store the result. EVEN-EVEN This machine will be a validator to insure that the input string on the tape has an even number of 0's and an even number of 1's. They can be arranged in any way, as long as the count of 0's and the count of 1's are both even. The machine begins on the first symbol of the string and will leave the tape unchanged and will enter into state 5 (halt) only if the string is "accepted." A Turing Machine such as this is said to be a generator of a language. The language generated by the TM is the set of all valid strings (each called a sentence) accepted by the machine. For example, the first few sentences in the language of EVEN-EVEN are:
ADD This machine actually performs an arithmetic computation. The input tape will be composed of two positive integers, represented in unary. In other words, the values are represented as,
The two integers are separated by a "+" symbol. After running the machine, the result on the tape is the sum of the two values.
The monus operation is defined as, m monus n = min(m - n, 0)Thus, monus is integer subtraction where the smallest possible result is 0. The input tape will contain an integer m, represented in unary, separated by a "-" symbol, then an integer n, represented in unary. After running the machine, the result in the tape is m monus n. For example, the tape would become11111-111bbbb ^ while the tape11bbbbbbbbbbb ^ would become111-11111bbbb ^ bbbbbbbbbbbbb ^ DELETE This machine will delete the symbol on the input tape which the read head is positioned upon at the beginning of execution. In other words, the tape would become01110001bbbb ^ 0110001bbbb ^ INSERT new
This machine will shift everything from current position to the right and insert the symbol new into the current position. For example, if we wished to insert a into01110001bbbb ^ 011$10001bbbb ^ COPY This machine will make a copy of the string on the tape, separating it from the original string by a single blank. For example, the input tape would become01110001bbbbbbbbbbbbbb ^ 01110001b01110001bbbbb ^ UTM The Universal Turing Machine. This machine begins with the serial number for any TM, P, and the input, x, to P and then simulates the output for P(x).
In other words, UTM is an interpreter for Turing Machines. It will simulate the action of any other TM. Such a machine would be difficult to describe in state diagrams, but a proof exists which verifies that the UTM exists. In other words, such a machine can be built and we can assume its existence in any of our other discussions, though the proof of this machine's existence is far beyond the scope of our course.
Church-Turing Thesis It's not surprising that we can do these computations .... and that people have figured out how to do sorting, deleting data, copying data, all kinds of math, etc, using Turing Machines. The TM can do anything that's computable (probably). "It is believed that there are no functions that can ever be defined by humans, whose calculation can be described by some well-defined mathematical algorithm that people can be taught to perform, that cannot be computed by a TM. Thus the TM is believed to be the ultimate calculating mechanism"This is a Thesis, not a Theorem which means it is not provable in normal ways. For example, it is not easy to deal with terms like: "Can Ever Be Described By Humans" or "Algorithms that People can be Taught to Perform" since there are no AXIOMS that include the notion of "PEOPLE" and what they we can be taught to do. This is very vague! Imagine that we had no AXIOMS about Algebra. In that case, we couldn't prove that 2(x+y) = 2x+2y; instead we could make empirical observations such as the following: Wow! Every time we tried an example, 2(x+y) seemed to be the same as 2x+2y. Is this a proof? Not really. Maybe we were very lucky and there might be cases where the observation won't work out. But it makes us feel good about accepting the notion that 2(x+y) = 2x+2y, without having the axioms of algebra to give us an irrefutable proof.x y x+y 2(x+y) 2x 2y 2x+2y --- --- ----- -------- ---- ---- ------- 0 0 0 0 0 0 0 1 1 2 4 2 2 4 2 2 4 8 4 4 8 5 3 8 16 10 6 16 100 4 104 208 200 8 208 The Church-Turing thesis has been examined in this empirical manner. No one has ever been able to define a function whose calculation can be described by some well-defined mathematical algorithm that people can be taught to perform, that cannot be computed by a TM. Perhaps, someday someone may find a task that humans agree is an algorithm but that cannot be executed by a TM. But not so far. And most researchers believe that it will never happen.
Thus, the Church-Turing thesis is accepted as an article of faith by most computer theorists.
TURING MACHINES and COMPUTABILITY The TM can be used as a model to determine whether something IS computable to start with. PROBLEMS THAT CANNOT BE SOLVED. EVER. 1. HALTING PROBLEM It would be helpful if a programmer had a utility tool which would scan a program they are writing and some input string and could alert the programmer: This program will never halt on this inputCan the program, H, be written to compute this output? THEOREM H does not exist.PROOF Proof by contradiction. Assume H exists. H is a machine which uses two inputs on the tape: The serial number of the program, P, to be checkedH always halts and correctly answers: Y, if P(s) eventually will haltUse the powerful machine H to build the following machine, H': input: The serial number of the the program, P, to be checkedSo, H determines if P is a program that halts with itself as input. If so, H' runs forever, but if P is a program that runs forever with itself as input, then H' stops. Before continuing, it might seem that this is a silly machine to construct. That may be true, but the point is, if H exists, then we CAN construct this silly machine, because we've previously demonstrated that it is trvial to copy a tape, it is trivial to go into a deliberate infinite loop and it is trivial to halt immediately. Now, ..... here's the magic ......, what happens after we build H' and determine its serial number if we send H' into H' as x? If H' will run forever on H' as input, then H' stops.Umm ..... say that again????
Since all parts of H' are trivial except H, it follows that the initial assumption that H
exists is incorrect.
2. KOLMOGOROV COMPLEXITY Is a string of numbers random? EXAMPLE 1:
This string is clearly non-random. It's 0100 repeated over and over.
A TM could generate n copies of the string with ease. input tape:
Algorithm:
Pretty short program to build a very large string. Thus, the string is not random.
EXAMPLE 2:
Seems pretty random (it's too small to be of any interest, but one could imagine a similar larger string.
Suppose our compression software doesn't compress it. Does that mean it's random? Or does it mean that
we don't have the world's ULTIMATE COMPRESSOR .... Is it random? What do you think? Click for an answer
EXAMPLE 3:
Again, it seems pretty random. But, can you find a secret pattern? answer
EXAMPLE 4:
Can you find the pattern this time? answer
HOW DO WE JUDGE THE RANDOMNESS OF A STRING? This is an important question since many encryption algorithms use randomly chosen prime numbers as a basis of encoding messages. In the early 1960's, Soviet mathematician, Kolmogorov, described the randomness of a string in terms of the length of the smallest program and data set, P(x), which could generate the string, s. That is, P and its input, x, are given to a UTM and the result of UTM(P,x) = s. For convenience we may think of P and x taken together as P' which is the smallest program which will generate s on a UTM. Using mathematical symbolism, K(s) = ( length(P') : P' is the smallest program which generates s )The larger the value of K(s) the more incompressible, or random, s is. The value of K(s)/s is the percentage of compression that can be obtained with the best possible compressor. QUESTION: Do random strings exist, that is, are there strings that are not compressible? This is a DECIDABLE question. There is a PROOF that shows INCOMPRESSIBLE STRINGS EXIST IN ABUNDANCE! The proof is beyond the scope of this course, but the results are striking. For example, the proof shows that of all the 100 bit strings that are possible, only about 1 string in 32 million can be compressed to 75% of its original size (or smaller). If we want to compress a this 100 bit string to 20% of its original size, then only about 1 string in one thousand billion trillion strings can be compressed this much!!! QUESTION: Can a program be designed which will examine a string, s, and determine whether it is one of the many random string? This is the same as asking it to determine K(s) since that's our metric for randomness. THEOREM No program exists to compute K(s). Note: we can approximate K(s) by running our best compressor, but that doesn't guarantee that we've found the hidden best way to compress the string (remember the BCD pi example!) PROOF Again, by contradiction. Assume that program P exists (as a TM, for example) to compute K(s). Use this powerful machine to do the following: 1. Design a simple COUNTER TM which successively outputs all 1-character strings, then all 2-character strings, all 3-character strings, etc. This is a trivial machine to construct. |